// 统一管理首页模块接口
import requset from "@/utils/request";
import type { HospitalResponseData, HospitalLevelAndRegionResponseData, HospitalInfo } from "./type";
enum API {
    // 获取已有的医院的数据
    HOSPITAL_URL = '/hosp/hospital/',
    // 获取医院的等级与地区
    HOSPITALLEVELANDREGION_URL = '/cmn/dict/findByDictCode/',
    // 根据关键字医院的名字获取数据
    HOSPITALINFO_URL = "/hosp/hospital/findByHosname/"
}

// 获取已有的医院的数据接口
export const reqHospital = (page: number, limit: number, hostype = '', districtCode = '') => {
    return requset<any, HospitalResponseData>({
        url: API.HOSPITAL_URL + `${page}/${limit}`,
        method: 'get',
        params: {
            hostype,
            districtCode
        }
    });
};
// 获取医院的等级与地区接口
export const reqHospitalLevelAndRegion = (dictCode: string) => {
    return requset<any, HospitalLevelAndRegionResponseData>({
        url: API.HOSPITALLEVELANDREGION_URL + dictCode,
        method: 'get',
    });
};
// 根据关键字医院的名字获取数据接口
export const reqHospitalInfo = (hosname: string) => {
    return requset<any, HospitalInfo>({
        url: API.HOSPITALINFO_URL + hosname,
        method: 'get',
    });
};